# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: leon

import functools

from coin.exchange.bequant_v2.kr_rest.product import BequantProduct
from coin.exchange.bequant_v2.book_builder import BequantBookBuilder
from coin.exchange.hitbtc_v2.ws.handler import HandlerBase


class BequantTraits(object):
  @classmethod
  @functools.lru_cache(maxsize=32)
  def get_product_from_symbol(cls, symbol):
    return BequantProduct.FromStrNativeProduct(symbol)


class BequantHandler(HandlerBase):
  BookBuilderType = BequantBookBuilder
  TraitsType = BequantTraits
